﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SeaButtleMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<SeaBattle.UI.Web.Models.RoomViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ShowOwnerGames
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="room-left">
    <div class="left-panel">
        <div class="account-panel">
        Your account: <span class="balance-amount"><%: Model.PlayerAccountBalance %></span>
        </div>
        <div class="current-games-panel">
         <%
             Html.RenderAction("GameList", "Room", new { playerLogin = User.Identity.Name }); 
         %>
         </div>
     </div>

    <div class="game-list-panel">
    <h2>Your Games</h2>
    <% foreach (var game in Model.GameList){ %>
        <div class="game-list-element">
        <div class="star"></div>
      <p>Preset: <span class="preset"><%: game.Preset %></span></p>                                     
      <p>Player: <span> <%: Html.ActionLink(game.Creator.Name,"Index","Profile", new {login=game.Creator.Login}, new {}) %> </span></p>
      
          <p><span id="delete-link-<%: game.Id.ToString() %>">
                <%: Ajax.ActionLink("Delete game", "Delete", "Room", new { GameId = game.Id },
                    new AjaxOptions { UpdateTargetId = "delete-link-" + game.Id.ToString() }) 
                %>
             </span>
          </p>
       
      
      </div>
    <%} %>
    </div>
    </div>

    <div class="right-panel">
        <%
            Html.RenderAction("RightPanel", "Room");      
        %>
    </div>

</asp:Content>
